import { createRouter, createWebHistory , createWebHashHistory} from "vue-router";

import Layout from '../layout/index.vue'


// 默认路由（本地单独启动）
let prefix = '/'

const routes = [
    {
        path: '/login',
        name: 'Login',
        menu_name: '登录',
        component: () => import('@/views/Login/index.vue')
    },
    {
        path: prefix,
        name: 'layout',
        component: Layout,
        children: [
            {
                path: '/',
                redirect: '/InputInfo'
            },
           
            {
                path: 'InputInfo',
                name: 'InputInfo',
                menu_name: '录入信息',
                component: () => import('@/views/InputInfo/index.vue')
            },
            
        ]
    },

]

const router = createRouter({
    history: createWebHistory(),
    routes
})

// const originalPush = VueRouter.prototype.push
// VueRouter.prototype.push = function push(location) {
//   return originalPush.call(this, location).catch(err => err)
// }

export default router
export const routerdata = routes
